<#import "/common/function.ftl" as fn>
<@fn.header _title="核对家庭基本信息">
<script language="javascript" type="text/javascript" src="${base}/web/js/My97DatePicker/WdatePicker.js"></script>
<script language="javascript" type="text/javascript" src="${base}/web/js/JScript.js"></script>
</@fn.header>
<body>
    <div class="rightBk">
    	<@fn.position _value="信息核实 &gt;&gt; 核对家庭基本信息" /> 
        <!-- 选项卡 -->
        <div style="margin:0px 0;height:30px">
        	<ul class="tab">
            	<li class="visited"><a href="${base}/infoverify/${checkTotal.id}/${taskId?c}/${result}">核对家庭基本信息</a></li>
            	<li><a href="${base}/infoverify/familyMemberInfo/${checkTotal.id}/${taskId?c}/${result}">核对家庭成员基本信息</a></li>
            	<li><a href="${base}/infoverify/familyMemberIncome/${checkTotal.id}/${taskId?c}/${result}">家庭成员可支配收入</a></li>
           	 	<li><a href="${base}/infoverify/familyMemberProperty/${checkTotal.id}/${taskId?c}/${result}">家庭成员财产</a></li>
            	<li><a href="${base}/infoverify/sendCheck/${checkTotal.id}/${taskId?c}/${result}">核实意见</a></li>
        	</ul>
        </div>
        <!-- title -->
       <div class="title">
            <div class="title-middle">
                <div class="title-left">
                </div>
                <div class="title-caption">
                    委托信息</div>
                <div class="title-right">
                </div>
            </div>
        </div>
        <!-- table -->
        <form action="${base}/infoInput/updateFamilyBasicInfo/" method="POST" name="familyBasicForm" id="familyBasicForm">
        <table class="table1">
            <colgroup>
                <col class="GridCaption" style="width:12%; background-color: #eef3f7;" />
                <col style="width: 250px;" />
                <col class="GridCaption" style="width:12%; background-color: #eef3f7;" />
                <col />
            </colgroup>
            <tr>
                <td>
                    业务类型</td>
                <td>
                    <select name="entrustType" id="Select3" class="select1">
                    	<#list types as type>
                        	<#if ((checkTotal.entrustInfo!=null) && (type.code==checkTotal.entrustInfo.type))>
                        		<option value="${type.code}" selected>${type.name}</option>
                        	<#else>
                        		<option value="${type.code}">${type.name}</option>
                        	</#if>
                        </#list>
                    </select></td>
                <td>
                    委托机构</td>
                <td>
                    <select name="entrustOrg" id="Select2" class="select1">
                        <option selected="selected" value="01">民政局</option>
                        <option value="02">住房保障房屋管理局</option>
                    </select></td>
            </tr>
            <tr>
                <td>
                    证件类型</td>
                <td>
                    <select id="Select1" name="entrustIdType" class="select1">
                       <#list idTypes as idType>
                        	<#if ((checkTotal.entrustInfo!=null) && (idType.code==checkTotal.entrustInfo.idType))>
                        		<option value="${idType.code}" selected>${idType.name}</option>
                        	<#else>
                        		<option value="${idType.code}">${idType.name}</option>
                        	</#if>
                        </#list>
                    </select></td>
                <td>
                    证件号码</td>
                <td>
                	<#if (checkTotal.entrustInfo!=null)>
                    <input name="entrustIdNumber" type="text" id="txtMobileJSF1" class="input4" maxlength="30"
                        value="${checkTotal.entrustInfo.idNumber}" require="true" dataType="Limit" min="1" max="50" msg="长度为1~50" /></td>
                    <#else>
                    <input name="entrustIdNumber" type="text" id="txtMobileJSF1" class="input4" maxlength="30"
                        value="" require="true" dataType="Limit" min="1" max="50" msg="长度为1~50" /></td>
                    </#if>
            </tr>
            <tr>
                <td>
                    委托人</td>
                <td>
                	<#if (checkTotal.entrustInfo!=null)>
                    <input name="entrustPerson" type="text" id="Text6" class="input4" value="${checkTotal.entrustInfo.entrustPerson}" require="true" dataType="Limit" min="1" max="50" msg="长度为1~50" />
                     <#else>
                     <input name="entrustPerson" type="text" id="Text6" class="input4" value="" require="true" dataType="Limit" min="1" max="50" msg="长度为1~50" />
                    </#if>
                </td>
                <td>
                    委托编号</td>
                <td>
                	<#if (checkTotal.entrustInfo!=null)>
                    <input name="entrustNumber" type="text" id="Text8" class="input4"  value="${checkTotal.entrustInfo.entrustNumber}" require="true" dataType="Limit" min="1" max="50" msg="长度为1~50" />
                     <#else>
                     <input name="entrustNumber" type="text" id="Text8" class="input4"  value="" require="true" dataType="Limit" min="1" max="50" msg="长度为1~50" />
                    </#if>
                </td>
            </tr>
            <tr>
                <td>
                    委托日期</td>
                <td>
                	<#if (checkTotal.entrustInfo!=null)>
                    <input name="entrustDate" type="text" id="txtReciveDate0" class="input4"  value="${checkTotal.entrustInfo.entrustDate?string('yyyy-MM-dd')}" onclick="WdatePicker()" require="true" dataType="Require" msg="填写不正确" readonly="readonly" />
                    <#else>
                     <input name="entrustDate" type="text" id="txtReciveDate0" class="input4"  value="" onclick="WdatePicker()" require="true" dataType="Require" msg="填写不正确" readonly="readonly" />
                    </#if>
                </td>
                <td>
                    联系电话</td>
                <td>
                <#if (checkTotal.entrustInfo!=null)>
                    <input name="entrustPhone" type="text" id="txtMobileJSF0" class="input4" value="${checkTotal.entrustInfo.phone}" require="true" dataType="tel" msg="填写不正确" /></td>
                    <#else>
                    <input name="entrustPhone" type="text" id="txtMobileJSF0" class="input4" value="" require="true" dataType="tel" msg="填写不正确" /></td>
                    </#if>
            </tr>
		</table>
        <br />
        <div class="title">
            <div class="title-middle">
                <div class="title-left">
                </div>
                <div class="title-caption">
                    申请人代表基本信息</div>
                <div class="title-right">
                </div>
            </div>
        </div>
        <!-- table -->
        <table class="table1">
            <colgroup class="GridCaption" style="width:12%; background-color: #eef3f7;" ></colgroup>
            <colgroup style="width: 20%;" ></colgroup>
            <colgroup class="GridCaption" style="width:12%; background-color: #eef3f7;" ></colgroup>
            <colgroup style="width: 20%;" ></colgroup>
            <colgroup class="GridCaption" style="width:12%; background-color: #eef3f7;" ></colgroup>
            <colgroup style="width: 20%;" ></colgroup>
            <tr>
            	<td>申请人姓名</td>
                <td>
                	<input name="familyMemberName" type="text" id="Text6" class="input4" value="${(fm.name)!}" require="true" dataType="Limit" min="1" max="50" msg="长度为1~50" />
                </td>
            	<td>证件类型</td>
           		<td>
	            <select name="familyMemberIdType" id="ddlCertType0" class="select1">
	                	<#list idTypes as idType>
                        	<#if (idType.code==fm.idType)>
                        		<option value="${idType.code}" selected>${idType.name}</option>
                        	<#else>
                        		<option value="${idType.code}">${idType.name}</option>
                        	</#if>
                    	</#list>
            	</select>
            	</td>
            	<td>证件号</td>
            	<td><input name="familyMemberIdNumber" type="text" id="txtCertCodeJSF0" class="input4" value="${fm.idNumber}" require="true" dataType="Limit" min="1" max="50" msg="长度为1~50" /></td>
            </tr>
            <tr>
                <td>性别</td>
           		<td>
		            <select name="" class="select1">
		                <option value="01" selected="selected">男</option>
		                <option value="02">女</option>
	            	</select>
            	</td>
                <td>民族</td>
                <td>
                    <select name="familyMemberNation" id="Select8" class="select1">
                        <#list nations as nation>
                        	<#if (nation.code==fm.nation)>
                        		<option value="${nation.code}" selected>${nation.name}</option>
                        	<#else>
                        		<option value="${nation.code}">${nation.name}</option>
                        	</#if>
                    	</#list>
                    </select>
                </td>
                <td>出生日期</td>
                <td><input name="birthday" type="text" class="input4" value="${(fm.birthday?string('yyyy-MM-dd'))!}" require="true" dataType="Require" msg="填写不正确" onClick="WdatePicker()" readonly="readonly" /></td>
            </tr>
            <tr>
                <td>政治面貌</td>
                <td>
                    <select name="familyMemberPoliticalStatus" id="Select8" class="select1">
                    	<#list politicalStatusList as _politicalStatus>
                        	<#if (_politicalStatus.code==fm.politicalStatus)>
                        		<option value="${_politicalStatus.code}" selected>${_politicalStatus.name}</option>
                        	<#else>
                        		<option value="${_politicalStatus.code}">${_politicalStatus.name}</option>
                        	</#if>
                    	</#list>
                    </select>
                <td>婚姻状况 </td>
                <td>
                    <select name="familyMemberMaritalStatus" id="Select8" class="select1">
                        <#list maritalStatusList as maritalStatus>
                        	<#if (maritalStatus.code==fm.maritalStatus)>
                        		<option value="${maritalStatus.code}" selected>${maritalStatus.name}</option>
                        	<#else>
                        		<option value="${maritalStatus.code}">${maritalStatus.name}</option>
                        	</#if>
                    	</#list>                     
                    </select>
                </td>
            </tr>
            
            <tr>
			    <td>固定电话</td>
                <td>
                	<input name="familyMemberPhone" type="text" id="Text6" class="input4" value="${fm.phone}" require="true" dataType="Phone" msg="填写不正确" />
                </td>
                <td>移动电话 </td>
                <td>
                	<input name="familyMemberMobile" type="text" id="txtMobileJSF0" class="input4" value="${fm.mobile}" require="true" dataType="Mobile" msg="填写不正确" />
                </td>
                <td>邮政编码</td>
                <td><input name="zipCode" type="text" class="input4" value="${(fm.zipCode)!}" require="true" dataType="Zip" msg="填写不正确" /></td>
            </tr>            
            <tr>
                <td>户籍所在地</td>
                <td colspan="3">
                    <select id="Select6" class="select1">
                        <option selected="selected" value="01">沈阳市</option>
                    </select>
                    <select name="familyMemberHouseholdDistrictCode" id="Select7" class="select1">
                      <#list citys as city>
                        	<option value="${city.code}">${city.name}</option>
                      </#list>
                    </select>
 	                派出所
                </td>
                <td>户籍类型</td>
           		<td>
	            <select name="" class="select1">
	                <option value="01" selected="selected">户籍类型数据</option>
            	</select>
            	</td>
            </tr>       
            <tr>
                <td>现居住地址 </td>
                <td colspan="4">
                    <select id="addrCity" class="select1">
                        <option selected="selected" value="01">沈阳市</option>
                    </select>
                    <select id="addrArea" class="select1">
                      <#list citys as city>
                        	<option value="${city.code}">${city.name}</option>
                      </#list>
                    </select>
                    <select name="familyMemberLivingDistrictCode" id="addrStreet" class="select1">
                      <#list streets as street>
                        	<option value="${street.code}">${street.name}</option>
                      </#list>
                    </select>
                    <input name="familyMemberLivingAddress" type="text" id="txtMobileJSF0" class="input4" onclick="this.select()" value="${fm.livingAddress}" require="true" dataType="Limit" min="1" max="50" msg="长度为1~50" />
                </td>
            </tr>

            <tr>
                <td>现居住地开始居住时间</td>
                <td>
	                <#if (fm.startDateLiving!=null)>
	                    <input name="familyMemberStartDateLiving" type="text" id="Text6" class="input4" value="${fm.startDateLiving?string('yyyy-MM-dd')}" require="true" dataType="Require" msg="填写不正确" onClick="WdatePicker()" readonly="readonly" />
	                <#else>
	                    <input name="familyMemberStartDateLiving" type="text" id="Text6" class="input4" require="true" dataType="Require" msg="填写不正确" onClick="WdatePicker()" readonly="readonly" />
	                </#if>
                </td>
                <td>文化程度 </td>
                <td>
                	<select name="familyMemberEducation" id="txtMobileJSF0" class="select1">
                      <#list educations as education>
                      		<#if (education.code==fm.education)>
                        		<option value="${education.code}" selected>${education.name}</option>
                        	<#else>
                        		<option value="${education.code}">${education.name}</option>
                        	</#if>
                      </#list>
                    </select>
               </td>
               <td>健康状况</td>
                <td>
                	<input name="familyMemberHealthStatus" type="text" id="txtCertCodeJSF1" class="input4" value="${fm.healthStatus}" require="true" dataType="Limit" min="1" max="50" msg="长度为1~50" />
                </td>
            </tr>

            <tr>
                <td>劳动能力丧失状况</td>
                <td>
                <select name="familyMemberLaborLossStatus" id="txtMobileJSF0" class="select1">
	                <#list laborlost as ll>
	                	<#if (ll.code==fm.laborLossStatus)>
	                        <option value="${ll.code}" selected>${ll.name}</option>
	                    <#else>
	                        <option value="${ll.code}">${ll.name}</option>
	                    </#if>
	                </#list>
                </select>
                </td>
                <td>残疾等级</td>
           		<td>
	            <select name="disabilityDegree" class="select1">
	                  <option value="">请选择</option>
	                  <#list disabilityDegreeList as ll>
		                	<#if (ll.code==fm.disabilityDegree)>
		                        <option value="${ll.code}" selected>${ll.name}</option>
		                    <#else>
		                        <option value="${ll.code}">${ll.name}</option>
		                    </#if>
	                  </#list>
            	</select>
            	</td>
                <td>所患主要疾病名称</td>
                <td><input name="" type="text" class="input4" value="${(fm.diseaseName)!}" require="true" dataType="Limit" min="1" max="50" msg="长度为1~50" /></td>
            </tr>
        </table>
            <br />
             <!-- title -->
        <div class="title marginTop15">
            <div class="title-middle">
                <div class="title-left">
                </div>
                <div class="title-caption">
                    核对家庭经济状况</div>
                <div class="title-right">
                </div>
            </div>
        </div>
         <!-- table -->
        <table class="tableCenter" style="text-align:left;vertical-align:middle;">
            <tr>
               <#if (checkTotal.dateApprovedProperty!=null)>
                <td>
                    截止<input name="dateApprovedProperty" id="Text1" type="text" value="${checkTotal.dateApprovedProperty?string('yyyy-MM-dd')}" require="true" dataType="Require" msg="填写不正确" onClick="WdatePicker()" readonly="readonly" />家庭人均财产为<input id="Text2" 
                        name="reportedPropertyAmount" type="text" value="${checkTotal.reportedPropertyAmount}" require="true" dataType="Number" msg="填写不正确" />元
                </td>
               <#else>
               <td>
                    截止<input name="dateApprovedProperty" id="Text1" type="text" value="" require="true" dataType="Require" msg="填写不正确" onClick="WdatePicker()" readonly="readonly" />家庭人均财产为<input id="Text2" 
                        name="reportedPropertyAmount" type="text" value="" require="true" dataType="Number" msg="填写不正确" />元
                </td>
               </#if>
            </tr>
            <tr>
            	<#if (checkTotal.startDateApprovedIncome!=null)>
                <td>
                    <input name="startDateApprovedIncome" id="Text3" type="text" value="${checkTotal.startDateApprovedIncome?string('yyyy-MM-dd')}" require="true" dataType="Require" msg="填写不正确" onClick="WdatePicker()" readonly="readonly" />至<input id="Text4" 
                        name="endDateApprovedIncome"  type="text" value="${checkTotal.endDateApprovedIncome?string('yyyy-MM-dd')}" require="true" dataType="Require" msg="填写不正确" onClick="WdatePicker()" readonly="readonly" />的家庭人均可支配收入为:<input id="Text5" 
                        name="reportedIncomeAmount" type="text" value="${checkTotal.reportedIncomeAmount}" require="true" dataType="Number" msg="填写不正确" />元
                </td>
            	<#else>
            	<td>
            	 <input name="startDateApprovedIncome" id="Text3" type="text" value="" require="true" dataType="Require" msg="填写不正确" onClick="WdatePicker()" readonly="readonly" />至<input id="Text4" 
                        name="endDateApprovedIncome"  type="text" value="" require="true" dataType="Require" msg="填写不正确" onClick="WdatePicker()" readonly="readonly" />的家庭人均可支配收入为:<input id="Text5" 
                        name="reportedIncomeAmount" type="text" value="" require="true" dataType="Number" msg="填写不正确" />元
                </td>
            	</#if>
            </tr>
        </table>
        <!-- title -->
     
        <!-- button -->
        <div class="marginTop15 alignCenter">
            <img src="${base}/web/img/btnSave.gif" alt="" id="saveFamilyBasicInfo"/>
            <!--<img src="${base}/web/img/btnNext.gif" alt="" onclick="javascript:nextStep();"/>-->
        </div>
        <input type="hidden" name="checkTotalId" value="${checkTotal.id}"/>
        </form>
    </div>
    <script language="javascript"> 
    $("#saveFamilyBasicInfo").click(function() {
	if(!Validator.Validate($("#familyBasicForm").get(0))){
    	return false;
    }
    var url = "${base}/infoInput/updateFamilyBasicInfo/";
    $.ajax({
           type: "POST",
           url: url,
           data: $("#familyBasicForm").serialize(),
           error: function()
           {
               alert("出错啦！");
           },
           success: function(data)
           {
           	   if(data.result){
               	alert("保存成功！");
               }else{
               	alert("保存失败，请将表单信息填写完整！");
               }
           }
         });

    return false;
	});
	
	function nextStep(){
		window.location.href="${base}/infoInput/familyMemberInfo/${checkTotal.id}/${taskId}"; 
	}
	
    </script>
  
</body>
</html>